//strlen的模拟
#pragma warning(disable:4996)
#include<stdio.h>
//循环实现
int My_Strlen1(char arr[])
{
	int count = 0;
	int i = 0;
	while(arr[i] != '\0')
	{
		count++;
		i++;
	}
	return count;
}
//递归实现
int My_Strlen2(char arr[])
{
	
	if (arr[0] == '\0')
	{
		return 0;
	}
	else
	{
		return (1 + My_Strlen2(arr+1));
	}
}
int main()
{
	char arr[] = "abcdef";
	int ret1 = My_Strlen1(arr);
	int ret2 = My_Strlen2(arr);
	printf("%d\n", ret1);
	printf("%d\n", ret2);
	return 0;
}